# ifndef __AlanWpr_H_
# define __AlanWpr_H_

# ifdef _MSC_VER
#	pragma pack (push, 1)
# endif

const DWORD c_dwWprWptSignature = 0x5C38A600;
const size_t c_cWprMaxWaypoints = 1000;

struct CWprWaypointsHdr {
	DWORD dwSignature;

	WORD  wCurrentWaypoints;
	WORD  wNextWaypoints;

	WORD  wIdx   [c_cWprMaxWaypoints];
	BYTE  btUsed [c_cWprMaxWaypoints];
};

struct CWprWaypoint {
	char  strName [8];
	char  strComment [12];

	LONG  lX, lY;

	DWORD dwDate;
	DWORD dwTime;

	WORD  wRoutesRefs;
	BYTE  btActive;
	BYTE  btType;
};

const DWORD c_dwWprRoutesSignature = 0xD87F5900;
const size_t c_cWprMaxRoutes = 50;
const size_t c_cWprMaxWaypointsInRoute = 150;

struct CWprRoutesHdr {
	DWORD dwSignature;

	WORD wCurrentRoutes;
	WORD wNextRoutes;

	WORD wIdx   [c_cWprMaxRoutes];
	BYTE btUsed [c_cWprMaxRoutes];

	WORD wNavigationRoute;
};

struct CWprRoute {
	char  strName [8];
	char  strComment [12];

	WORD  wWaypoints;
	WORD  wWptIdx [c_cWprMaxWaypointsInRoute];

	WORD  wReserved;

	DWORD dwDate;
	DWORD dwTime;
};

struct CWprFile {
	CWprWaypointsHdr WptHdr;
	CWprWaypoint     Waypoints [c_cWprMaxWaypoints];

	CWprRoutesHdr    RoutesHdr;
	CWprRoute        Routes [c_cWprMaxRoutes];

	// NOTE: total size is 64K.
	BYTE             unused [5766];
};

# ifdef _MSC_VER
#	pragma pack (pop)
# endif

# endif // __AlanWpr_H_